Testing for halogenoalkanes
There is no need to make this reaction go to completion. The silver nitrate test is sensitive enough to detect fairly small concentrations of halide ions.
The mixture is acidified by adding dilute nitric acid. This prevents unreacted hydroxide ions reacting with the silver ions. Then silver nitrate solution is added.
Various precipitates may be formed from the reaction between the silver and halide ions:
Silver nitrate solution can be used to find out which halogen is present in a suspected halogenoalkane. The most effective way is to do a substitution reaction which turns the halogen into a halide ion, and then to test for that ion with silver nitrate solution.
Doing the reaction
The halogenoalkane is warmed with some sodium hydroxide solution in a mixture of ethanol and water. Everything will dissolve in this mixture and so you can get a good reaction.
The halogen atom is displaced as a halide ion: